<!--
 * @Author: sbotlp
 * @Email: sbotlp@sina.com
 * @Date: 2019-11-24 17:11:35
 * @LastEditTime: 2019-11-24 17:17:03
 * @Description: http://www.sbotlp.com.cn
 -->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  render函数-white用法.html
  <script>
    var obj= {
      name:'zhangsan',
      age:20,
      getAddress:function(){
        console.log('beijing');
      }
    };
    function fn() {
      console.log(obj.age);
      console.log(obj.name);
      obj.getAddress();
    };
    fn();
    // 日常开发别用with，就是坑
    function fn1(){
      with(obj){
        console.log(name);
        console.log(age);
        getAddress();
      }
    }
    fn1()
  </script>
</body>
</html>